package com.redoor.app.stake.basicdata.service.impl;

import com.redoor.app.stake.basicdata.dao.BaseHsfOperationLogMapper;
import com.redoor.app.stake.basicdata.model.BaseHsfOperationLog;
import com.redoor.app.stake.basicdata.service.BaseHsfOperationLogService;

import com.redoornetwork.framework.mybatis.service.AbstractService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by wangjunlei on 2018-02-28 20:37:42.
 */
@Service
public class BaseHsfOperationLogServiceImpl extends AbstractService<BaseHsfOperationLog, String> implements BaseHsfOperationLogService {

    @Autowired
    private BaseHsfOperationLogMapper baseHsfOperationLogMapper;

    @Override
    public int saveAll(List<BaseHsfOperationLog> list) {
        if(list != null && list.size() > 0){
            // baseHsfOperationLogMapper.insertList() 只能用自增的方式新增，当前表结构无法使用
            baseHsfOperationLogMapper.batchInsert(list);
            return 1;
        } else {
            return 0;
        }
    }
}
